package cn.dly.login.mapper;

import cn.dly.login.entity.Auth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Hrd
 * @since 2021-07-05
 */
@Mapper
public interface AuthMapper extends BaseMapper<Auth> {

    @Select("select auth.auth_id,auth.auth_name\n" +
            "from auth ,role_auth,user_role\n" +
            "WHERE auth.auth_id=role_auth.auth_id\n" +
            "AND user_role.role_id=role_auth.role_id\n" +
            "and user_role.username=#{username}")
    List<Auth> findAuth(String username);

}
